<template>
    <div>
        <HeaderIndex title="我的优惠券" :showTwo="false"></HeaderIndex>
        <div class="sousuo">
            <input type="text" placeholder="请输入优惠券密码"><button>添加</button>
        </div>
        <div class="quan" v-for="(v,i) in arr" :key="i" :value1="v.value" :value2="v.title" :value3="v.limitDesc" :value4="v.useTimeLimit">
            <div class="one">
                <span class="sp1">{{v.value}}</span><span class="sp2">元</span>
                <div>代金券</div>
            </div>
            <div class="two">
              <p>{{v.title}}</p>
              <div class="box1">{{v.limitDesc}}</div>
              <span class="sp3">{{v.useTimeLimit}}</span>
              <div class="box2">
                <span class="sp4">商家</span>
              </div>
            </div>
        </div>
    </div>
</template>

<script>
import getLink from "@/api/getLink.js";
export default {
  props: ["value1", "value2", "value3", "value4"],
  data() {
    return {
      arr: []
    };
  },
  mounted() {
    getLink("/my/youhui").then(ok => {
      this.arr = ok.data;
    });
  }
};
</script>

<style scoped>
.sousuo {
  width: 100%;
  height: 1rem;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0.12rem 0 0.15rem;
}
.sousuo > input {
  width: 5.2rem;
  height: 0.6rem;
  border: 1px solid #cccccc;
  border-radius: 5px;
  padding: 0 0.1rem;
}
.sousuo > button {
  margin-left: 0.1rem;
  margin-right: 0.35rem;
  color: red;
  border: none;
  background-color: rgb(245, 245, 245);
}
.quan {
  width: 92%;
  height: 2.515rem;
  margin: 0 auto;
  border-radius: 8px;
  overflow: hidden;
  /* border: 1px solid #d8d8d8; */
  display: flex;
  font-family: PingFangSC-Regular, Hiragino Sans GB, sans-serif;
  margin-bottom: 0.3rem;
  position: relative;
}
.one {
  position: absolute;
  top: 0;
  left: 0;
  width: 31%;
  height: 2rem;
  background-color: #c3c3c3;
  color: #fff;
  text-align: center;
  padding-top: 0.55rem;
}
.one > .sp1 {
  font-size: 0.7rem;
  font-weight: 700;
  text-align: center;
  line-height: 1.2;
}
.one > .sp2 {
  font-size: 0.36rem;
  font-weight: 700;
}
.one > div {
  width: 1.3rem;
  height: 0.4rem;
  border-top: 1px solid rgb(181, 181, 181);
  margin: 0 auto;
  padding-top: 0.06rem;
}
.two {
  width: 69%;
  height: 2.5rem;
  border-left: 1px dashed #d8d8d8;
  position: absolute;
  top: 0;
  right: 0;
  background: url("/img/guoqi.png");
  background-size: 1.3rem 1.3rem;
  background-position: top 0.14rem right 0.14rem;
  background-repeat: no-repeat;
  background-color: white;
}
.two > p {
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  margin-top: 0.2rem;
  padding: 0 0.32rem;
  font-size: 0.32rem;
  line-height: 0.48rem;
  height: 0.48rem;
  color: #333;
  width: 4rem;
}
.two > .box1 {
  margin-top: 0.12rem;
  padding: 0 0.32rem;
  font-size: 0.24rem;
  line-height: 0.28rem;
  color: #999;
  height: 1.28rem;
  border-bottom: 1px solid #c3c3c3;
}
.two > .sp3 {
  display: block;
  color: #777;
  line-height: 0.44rem;
  font-size: 0.24rem;
  text-align: right;
  white-space: pre-wrap;
  padding: 0 0.08rem;
  padding-left: 0.25rem;
}
.two > .box2 {
  position: absolute;
  top: 0;
  right: 0;
  border-color: #c3c3c3 #c3c3c3 transparent transparent;
  border-right: 20px solid #c3c3c3;
  border-top: 20px solid #c3c3c3;
  border-style: solid;
  border-width: 20px;
}
.two > .box2 > .sp4 {
  width: 35px;
  display: block;
  position: absolute;
  font-size: 12px;
  right: -30px;
  top: -9px;
  line-height: 1;
  -webkit-transform: rotate(45deg);
  transform: rotate(45deg);
  color: white;
}
</style>
